package com.ktjy.mapper.user;

//import jdk.nashorn.internal.objects.annotations.Constructor;

//import java.lang.reflect.Constructor;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class WuBian_1 {
    public static void main(String[] args) {
        try {
            Class clz=Class.forName("com.ktjy.mapper.user.Employee");
            Constructor declaredConstructor=clz.getDeclaredConstructor();
            Object o=declaredConstructor.newInstance();

            Field empNo=clz.getDeclaredField("empNo");
            Field empName=clz.getDeclaredField("empName");
            Field empPost=clz.getDeclaredField("empPost");
            Field empSalary=clz.getDeclaredField("empSalary");

            empNo.setAccessible(true);
            empNo.set(o,"JD001");
            empName.setAccessible(true);
            empName.set(o,"福星");
            empPost.setAccessible(true);
            empPost.set(o,"JAVA软件开发工程师");
            empSalary.setAccessible(true);
            empSalary.set(o,12000);

            Method showInfo=clz.getDeclaredMethod("showInfo");
            showInfo.invoke(o);
        }catch (Exception e) {
            e.printStackTrace();
        }

    }
}
